import { uploadType } from '@/utils/util'
const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
	columns: [
		{
			label: '休假类型',
			prop: 'leaveType',
			propName: 'leaveTypeLabel',
			custome:'tag',
			code: 'LEAVEMANAGEMENT_LEAVE_TYPE',
		},
		{ label: '开始时间', prop: 'leaveStartDate', span: 12 },
		{ label: '结束时间', prop: 'leaveEndDate', span: 12 },
        {
			label: '操作',
			prop: 'menu',
			width: 120,
			fixed: 'right',
		},
	],
}

// 详情
export const detailConfig = {
    inline: false,
    showBtn: false,
    labelPosition: 'left',
    column: [
      { label: '身份证号', prop: 'idCard', span: 12},
      { label: '姓名', prop: 'name', span: 12},
      {   
        label: '请假类型',
        prop: 'leaveType',
        propName:'leaveTypeLabel',
        type:"remoteSelect",
        api:"getDictItemList",
        code:"LEAVEMANAGEMENT_LEAVE_TYPE" 
      },
      { label: '开始时间', prop: 'leaveStartDate', span:12 },
      { label: '结束时间', prop: 'leaveEndDate',span:12 },
      { label: '备注', prop: 'note', span: 12 },
      { 
        label: '说明附件',
        prop:'accessories',
        type: 'upload',
              fileType: uploadType.fileMetaType,
              listType: 'text',
              labelPosition: 'top',
              showFileList: true,
              limit: 4,
              multiple: true,
        span: 24 
      },
    ]
  }

export const baseConfig = {
	pageName: '休假记录',
	dictcodes: ['LEAVEMANAGEMENT_LEAVE_TYPE'],
	rowKey: 'id',
	tipLabel: 'oldmanName',
	api: {
		index: 'view_dpEmployeeLeaveRecord_page',
	},
	auth: {
		index: 'view_dpEmployeeLeaveRecord_page',
	},
	menuBtn: [
		{
			icon: 'detail',
			label: '查看',
			type: 'primary',
			operate: 'detail',
			auth: 'view_dpEmployeeLeaveRecord_page',
			text: true,
			show: true,
		},
	],
	dialogConfig: {
		width: '80%',
	},
	tableConfig,
	detailConfig,
}
